
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu 
 * @Date : 2023/5/19 9:35
 */

#include "iostream"

using namespace std;

typedef long long ll;

int main() {
    int n, a, b;
    scanf("%d %d %d", &n, &a, &b);

    ll res = 0;
    for (int i = 0; i < n; ++i) {
        int x1, y1, x2, y2;
        scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
        x1 = max(x1, 0);
        y1 = max(y1, 0);
        x2 = min(x2, a);
        y2 = min(y2, b);
        if (x2 >= x1 && y2 >= y1) {
            res += (ll) (x2 - x1) * (ll) (y2 - y1);
        }
    }

    printf("%d", res);

    return 0;
}